<?php if($this->session->flashdata('message_status') != "" && $this->session->flashdata('message_status') == "0"): ?>
	<?php $display = ""; ?>
	<div class="alert alert-danger">
		<i class="fa fa-fw fa-times-circle"></i> <?php echo $this->session->flashdata('message'); ?>
	</div>
<?php elseif($this->session->flashdata('message_status') == "1"): ?>
	<?php $display = "none"; ?>
	<div class="alert alert-success">
		<i class="fa fa-fw fa-check-circle"></i> <?php echo $this->session->flashdata('message'); ?>
	</div>
	<small><a href="<?php echo site_url('Admin/post_page') ?>"><i class="fa fa-arrow-left"></i> Back to post list</a></small>
<?php endif; ?>

<?php if(isset($display)): ?>
	<div style="display: none;">
<?php endif; ?>
<div>
	<form action="<?php echo site_url("Post/delete_post_byAdmin/$result[id_post]") ?>" method="POST">
		<table class="table table-bordered">
			<tr>
				<th>ID</th>
				<th>Title</th>
				<th>Author</th>
				<th>Category</th>
				<th>Location</th>
				<th>Post Date</th>
			</tr>
			<tr>
				<td><?php echo $result['id_post'] ?></td>
				<td><?php echo $result['post_title'] ?></td>
				<td><?php echo $result['username_user'] ?></td>
				<td><?php echo $result['category_name'] ?></td>
				<td><?php echo $result['location_name'] ?></td>
				<td><?php echo $result['post_date'] ?></td>
				<td align="center" width="20%">
				<input name="btn_del_post_byadmn" type="submit" value="Delete Post" class="btn btn-danger btn-sm"/>
					<a href="<?php echo site_url('Admin/post_page') ?>" class="btn btn-warning btn-sm">Cancel</a>
				</td>
			</tr>
		</table>
	</form>
</div>